#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int averageValue(vector<int>& nums) {
        int count = 0;
        int add = 0;
        for (auto e : nums)
        {
            if (e % 3 == 0 && e % 2 == 0)
            {
                ++count;
                add += e;
            }
        }

        if (count == 0)
            return 0;
        return add / count;
    }
};